import java.io.File;

public class TestUrl {
    private static final String INPUT_PATH = "C:\\搜索项目的java文档-检索\\docs\\api";

    public static void main(String[] args) {
        File file = new File("C:\\搜索项目的java文档-检索\\docs\\api\\java.xml\\org\\xml\\sax\\EntityResolver.html");
        //先获取一个固定的前缀
        String part1 = "https://docs.oracle.com/en/java/javase/22/docs/api";
        String part2 = file.getAbsolutePath().substring(INPUT_PATH.length());
        System.out.println(part1+part2);
    }
}
